<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
    <script>
        //下面涉及到字符串的四种方法，search，match，split，replace。
        //【2】【切分】）string对象的split（）方法
        var regex2 = /,/;
        var string = "sky,moon,fly";
        console.log(string.split(regex2)); //["sky", "moon", "fly"]
    </script>
</body>

</html>